#!/usr/bin python3
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    n = input()
    a = [int(i) for i in input().split(' ')]

    a.sort()

    tmp1 = []
    tmp2 = []

    for i, e in enumerate(a):
        if i % 2 == 0:
            tmp1.append(e)
        else:
            tmp2.append(e)

    a = tmp1 + tmp2[::-1]

    for i in a:
        print(i, end=' ')